package com.wondertek.poms.core.filter.impl;

import com.wondertek.poms.core.filter.BaseRuleFilter;
import com.wondertek.poms.core.filter.RuleFilterChain;
import com.wondertek.poms.dao.po.Content;
import com.wondertek.poms.dao.po.DefaultPrdSal;
import com.wondertek.poms.dao.po.IRulePo;
import com.wondertek.poms.dao.po.PrdInfoRule;


/**
 * <p><b>CopyRightCpIdFilter Description:</b> 资费类型过滤器</p>
 * @author douzi
 * <b>DATE</b> 2019年9月27日 下午4:00:58
 */
public class FreeTypeFilter extends BaseRuleFilter {

	@Override
	public void doFilter(IRulePo rule, Content c, RuleFilterChain chain) {
		if (rule instanceof PrdInfoRule) {
			PrdInfoRule r = (PrdInfoRule) rule;
			this.moreFilter(r.getPrdRuleId(),
					r.getFreeType(),
					c.getFeeType(),
					chain,
					"资费类型-FeeType");
		} else if (rule instanceof DefaultPrdSal) {
			DefaultPrdSal r = (DefaultPrdSal) rule;
			this.baseFilter(r.getId(), 
					r.getFeeCharge() == null ? null : r.getFeeCharge() + "", 
					c.getFeeType(), 
					chain, 
					"资费类型-FeeType");
		}

		chain.doFilter(rule, c, chain);
	}

}
